Skip to content

Instrumental search improvement - #633

Merged
NeptuneHub merged 5 commits into
mainfrom
devel
Jun 11, 2026
Merged

Instrumental search improvement#633
NeptuneHub merged 5 commits into
mainfrom
devel

Conversation

@NeptuneHub

@NeptuneHub NeptuneHub commented Jun 11, 2026

Copy link
Copy Markdown
Owner

This PR is to improve the instruemntal song search in different way:

  • Instant playlist chat - added instrumental tool
  • Not related but fix of one char in search and of CJK single character search like 星

PR test builds:

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for filtering instrumental tracks across the AI tasks and tools pipeline. Key changes include adding keyword-based instrumental detection in planner.py, updating intent classifier prompts, and implementing database filtering and scoring based on the mood_vector in tool_impl.py. The search_database tool definition was also updated to expose the new instrumental boolean parameter. Feedback on these changes suggests compiling the _INSTRUMENTAL_RE regular expression at the module level in planner.py to avoid recompiling it on every function call, and coercing the instrumental parameter to a boolean in tool_impl.py to prevent potential truthiness bugs if it is passed as a string.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

I am having trouble creating individual review comments. Click here to see my feedback.

tasks/ai/planner.py (490-495)

medium

The regular expression _INSTRUMENTAL_RE is compiled inside the extract_hints function on every invocation. For better performance and consistency with other regex patterns in this file (such as _YEAR_RE and _DECADE_RE), it should be defined at the module level.

    if _INSTRUMENTAL_RE.search(text):

tasks/ai/tool_impl.py (713-714)

medium

If the instrumental parameter is passed as a string (e.g., 'false' or 'False') instead of a boolean, the truthiness check if instrumental: will evaluate to True because non-empty strings are truthy in Python. Coercing it to a boolean when it is a string prevents potential logic errors.

            if instrumental is not None:
                if isinstance(instrumental, str):
                    instrumental = instrumental.lower() in ('true', '1', 'yes')
                if instrumental:

@sonarqubecloud

Copy link
Copy Markdown

@NeptuneHub
NeptuneHub merged commit 4bbcd5f into main Jun 11, 2026
22 checks passed
@NeptuneHub
NeptuneHub deleted the devel branch June 11, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant